public class TestPerson{
	public static void main(String [] args ){
		Person p1 = new Person("mm",20);
		Person p2 = new Person("nn",30);
		System.out.println(p1.compare(p2)); 
	}
}

class Person{
	String name;
	int age; 
	public Person(String name,int age){
		this.name = name;
		this.age = age;
	}
	public boolean compare(Person p){
		return this.name.equals(p.name) && this.age == p.age;
	}
}


